<%--
  Created by IntelliJ IDEA.
  User: Lucky
  Date: 2020/6/26
  Time: 22:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>所有的书籍</title>

    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12">
                <div class="page-header">
                    <h3>书籍展示===============显示所有书籍</h3>
                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-3">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/addBookPage">新增</a>
            </div>
            <div class="col-md-9 " >
                <form class="form-inline" action="${pageContext.request.contextPath}/book/queryBookByName" method="post" style="float: right">
                    <span style="color: red">${error}</span>
                    <input class="form-control" type="text" name="bookname" placeholder="请输入要查询的书籍名称">
                    <input class="btn btn-primary" type="submit" value="查询">
                </form>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-12">
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <td class="text-center">id</td>
                            <td class="text-center">名称</td>
                            <td class="text-center">数量</td>
                            <td class="text-center">描述</td>
                            <td class="text-center">操作</td>
                        </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${list}" var="book">
                       <tr>
                           <td class="text-center">${book.bookid}</td>
                           <td class="text-center">${book.bookname}</td>
                           <td class="text-center">${book.bookcount}</td>
                           <td class="text-center">${book.detail}</td>
                           <td class="text-center">
                               <a href="${pageContext.request.contextPath}/book/updateBookPage?bookid=${book.bookid}">修改</a> &nbsp; | &nbsp;
                               <a href="${pageContext.request.contextPath}/book/deleteBook/${book.bookid}">删除</a>
                           </td>
                       </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>


</body>
</html>
